package com.huahai.security.core.supports;

import java.io.Serializable;

/**
 * @Author: Jun
 * @Date: 2020/7/17
 *
 * 请求的返回信息封装类
 */
public class ResultResponse implements Serializable {

    /**
     * 返回的状态码
     */
    private String status;
    /**
     * 返回的请求信息
     */
    private String message;

    /**
     * 返回的具体字段
     */
    private Object fields;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getFields() {
        return fields;
    }

    private void setFields(Object fields) {
        this.fields = fields;
    }

    public ResultResponse() {
    }

    private ResultResponse(String status) {
        this.status = status;
    }

    private ResultResponse(String status, String msg) {
        this(status);
        this.setMessage(msg);
    }

    private ResultResponse(String status, String msg, Object fields) {
        this(status, msg);
        this.setFields(fields);
    }

    public static ResultResponse build(String status) {
        return new ResultResponse(status);
    }

    public static ResultResponse build(String status, String msg) {
        return new ResultResponse(status, msg);
    }

    public static ResultResponse build(String status, String msg,Object fields) {
        return new ResultResponse(status, msg,fields);
    }

    @Override
    public String toString() {
        return "ResultResponse{" +
                "status=" + status +
                ", message='" + message + '\'' +
                ", fields=" + fields +
                '}';
    }
}
